<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('sites', function (Blueprint $table) {
            $table->id();
            $table->string('name', 50)->nullable()->comment('服务商名称');
            $table->string('account', 50)->nullable()->comment('账号');
            $table->string('password', 100)->nullable()->comment('密码');
            $table->char('mobile', 11)->nullable()->comment('手机号');
            $table->char('status', 1)->nullable()->default('t')->comment('是否启用 t:是 f:否');
            $table->string('avatar', 255)->nullable()->comment('头像');
            $table->dateTime('created_at')->nullable();
            $table->dateTime('updated_at')->nullable();
            $table->dateTime('deleted_at')->nullable();
            $table->index('account', 'idx_account')->nullable();
            $table->comment('服务商表');
        });

    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('sites');
    }
};
